<template>
	<view class="commentList">
		<block v-if="itemInner.resType == 'ask'">
			<!-- 我的提问 -->
			<view class="ansQueList spec hasBor" @tap="goQueInfoDet(itemInner.id,indexInner)">
				<view class="ansQuesTit multiEllip clamp2">{{itemInner.askTitle}}</view>
				<view class="queCon">
					<view class="inner multiEllip clamp4"><jyf-parser :html="itemInner.askContent" :selectable="true"></jyf-parser></view>
				</view>
				<view class="queBot spaceBet">
					<view class="time">{{itemInner.askAddTime}}</view>
					<view class="right hasFlex">
						<view class="ly hasFlex">
							<text class="iconfont icon-message"></text>
							<text>{{itemInner.askPlNum}}</text>
						</view>
						<view class="favor hasFlex">
							<text class="iconfont icon-favor"></text>
							<text>{{itemInner.askUpNum}}</text>
						</view>
					</view>
				</view>
			</view>
		</block>
		<block v-if="itemInner.resType == 'ack'">
			<view class="listItem spec" @tap="goQueInfoDet(itemInner.askId,indexInner)">
				<view class="quesWrap">
					<view class="listItemTop hasFlex">
						<view class="itemImg hasFlex">
							<view class="headImg"> 
								<image class="samePar" v-if="itemInner.askUserPortrait == ''" src="../../../../static/images/defHead.png"></image>
								<image class="samePar" v-else :src="getCloudFilePath(itemInner.askUserPortrait)"></image>
							</view>
							<view class="usename specCol">{{itemInner.askNickName}}</view>
						</view>
						<view class="topRight time">{{itemInner.askAddTime}}</view>
					</view>
					<view class="ansQuesTit multiEllip clamp2">{{itemInner.askTitle}}</view>
					<view class="queCon">
						<view class="inner multiEllip clamp4"><jyf-parser :html="itemInner.askContent" :selectable="true"></jyf-parser></view>
					</view>
					<view class="smIcon hasFlex">
						<view class="favor msg">
							<text class="iconfont icon-message"></text>
							<text>{{itemInner.askPlNum}}</text>
						</view>
						<view class="favor">
							<text class="iconfont icon-favor"></text>
							<text>{{itemInner.askUpNum}}</text>
						</view>
					</view>
				</view> 
			</view>
		</block> 
	</view> 
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser";
	export default {
		props:{
			tabIndex:Number,
			indexInner:Number,
			itemInner:Object
		},
		components:{
			jyfParser
		},
		methods:{
			replayMyAns(){
				this.$emit('replayMyAns')
			},
			goQueInfoDet(id,innerIndex){
				//var currOpt = tabIndex == 0 ? 'canReplay' : 'viewDet';
				this.$emit('goQueInfoDet',id,innerIndex);
			}
		}
	}
</script>

<style lang='scss' scoped>
	@import '@/static/scss/zxsPj.scss'; 
	@import '@/static/scss/ansQueList.scss';
	.smIcon{
		justify-content: flex-end;
	}
	.ansQuesTit{
		font-size: $font-size32;
		color: $pss-text-color3;
		font-weight: bold;
		margin-bottom: 20rpx;
	}
	.icon-wenhao{
		font-weight: normal;
		font-size: 36rpx;
		color: $pss-color-primary_1;
		margin-right: 5rpx;
	}
	.commentList{
		padding: 20rpx 30rpx 0;
		.listItem{
			margin-bottom: 10rpx;
			.favor{
				font-size: $font-size30;
				color: $pss-text-color8;
				display: flex;
				align-items: center;
				.icon-favor,
				.icon-message{
					margin-right: 5rpx;
					font-size: $font-size26;
					color:$pss-text-colord;
				}
				.icon-message{
					font-size: 34rpx;
				}
				&.msg{
					margin-right: 50rpx;
				}
			}
			.listBot{
				height: 70rpx;
				align-items: center;
				.replayBtn{
					padding: 0 20rpx;
					height: 50rpx;
					line-height: 50rpx;
					border-radius: 10rpx;
					background: $pss-color-green;
					color: #fff;
					font-size: $font-size28;
				}
			}
			&.spec{
				border-bottom: none;
				padding: 0;
			}
			.quesWrap{
				border-radius: 20rpx 20rpx 0 0;
				background: #fff;
				padding: 20rpx;
			}
			.usename.specCol{
				color: $pss-text-color3 !important;
			}
			.topRight.time{
				font-size: $font-size24;
				color: $pss-text-color8;
			}
			.itemCon.specCol{
				color: $pss-text-color8;
			}
			.ansWrap{
				border-radius: 0 0 20rpx 20rpx;
				background: #f2fdf9;
				padding: 20rpx;
				.ansCon{
					font-size: $font-size28;
					color:$pss-text-color3;
					.jd{
						color:$pss-color-green;
						font-weight: bold;
						margin-right: 5rpx;
					}
				}
				.ansTime{
					font-size: $font-size24;
					color:$pss-text-color8;
					margin-top: 10rpx;
					justify-content: flex-end;
				}
			}
		}
	}
</style>